package Generics;

import java.util.ArrayList;

/**
 * @author: leiwenkang
 * @date: 2019/5/7
 * @time: 15:51
 */
public class Test {
    public static void main(String[] args) {
        Pair<Integer, String> p1 = new Pair<>(1, "apple");
        Pair<Integer, String> p2 = new Pair<>(2, "pear");
        boolean same = Util.compare(p1, p2);

//        Object[] strings = new String[2];
//        strings[0] = "hi"; // OK
//        strings[1] = 100; // An ArrayStoreException is thrown.

        Class c1 = new ArrayList<String>().getClass();
        Class c2 = new ArrayList<Integer>().getClass();
        System.out.println(c1 == c2); // true
    }
}
